package com.wkck.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wkck.domain.RegisterUser;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface RegisterUserMapper extends BaseMapper<RegisterUser> {

    /**
     * 判断该用户名用户是否存在
     * @param username
     * @return
     */

    @Select("select * from user where username = #{username}")
    RegisterUser existUser(String username);

    /**
     * 判断用户名与手机号是否匹配
     * @param registerUser
     * @return
     */

    @Select("select * from user where username = #{username} and phone_number = #{phone_number}")
    RegisterUser usernameMatchesPhoneNumber(RegisterUser registerUser);

    /**
     * 根据用户名修改密码
     * @param registerUser
     * @return
     */

    @Update("update user set password = #{password} where username = #{username}")
    int updateUser(RegisterUser registerUser);
}
